//
//  RTJAutoServiceController.m
//  RuiTaiJinProject
//
//  Created by jayson on 2018/12/20.
//  Copyright © 2018年 leewei. All rights reserved.
//

#import "RTJAutoServiceController.h"
#import "RTJAutoMarkCell.h"

@interface RTJAutoServiceController ()
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation RTJAutoServiceController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.tableFooterView=[UIView new];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    self.tableView.estimatedRowHeight=300;
    [self.tableView reloadData];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return UITableViewAutomaticDimension;
    
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * ID = @"RTJAutoMarkCell";
    
    RTJAutoMarkCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (!cell) {
        
        cell = [[NSBundle mainBundle] loadNibNamed:@"RTJAutoMarkCell" owner:self options:nil][0];
    }
    
    [cell.btn1 addTarget:self action:@selector(xieyi1) forControlEvents:UIControlEventTouchUpInside];
    [cell.btn2 addTarget:self action:@selector(xieyi2) forControlEvents:UIControlEventTouchUpInside];
    [cell.btn3 addTarget:self action:@selector(xieyi3) forControlEvents:UIControlEventTouchUpInside];

    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    return  cell;
    
}

-(void)xieyi1{
    
    [self loadUrl:@"zidongtoubiao" title:@"自动投标服务授权书"];

}

-(void)xieyi2{
    
    [self loadUrl:@"dianziqianzhang" title:@"电子签章授权委托书"];

}

-(void)xieyi3{
    
    [self loadUrl:@"fengxianjiesishu" title:@"风险揭示书"];

}

-(void)loadUrl:(NSString *)url title:(NSString *)title{
    
    RTJHTMLViewController *vc = [[RTJHTMLViewController alloc]init];
    vc.title = title;
    vc.htmlStr = url;
    [self.navigationController pushViewController:vc animated:YES];
    
}
@end
